package com.tgy.config;

import com.tgy.bean.Dog;
import com.tgy.bean.DogFactoryBean;
import com.tgy.bean.Person;
import org.springframework.beans.factory.FactoryBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;

import javax.annotation.Resource;

@ComponentScan(basePackages = "com.tgy")
public class Config02 {

//  @Bean("dog1")
//  public FactoryBean<Dog> dog(Person person){
//
//    return new DogFactoryBean();
//  }

  @Bean("dog1")
  public Dog dog01(){

    return new Dog(1);
  }

  @Bean("dog1")
  public Dog dog02(){

    return new Dog(2);
  }
}
